package com.jsu.springboot_crop.service.impl;

import com.jsu.springboot_crop.dao.PurchaseDetailDao;
import com.jsu.springboot_crop.entity.PurchaseDetail;
import com.jsu.springboot_crop.entity.ToEcharts;
import com.jsu.springboot_crop.service.PurchaseDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Humura
 * @Date 2023/8/26 14:17
 * @Version 1.0
 */
@Service
public class PurchaseDetailImpl implements PurchaseDetailService {
    @Autowired
    private PurchaseDetailDao purchaseDetailDao;
    @Override
    public void add(PurchaseDetail purchaseDetail) {
        purchaseDetailDao.insertSelective(purchaseDetail);
    }
    @Override
    public List<PurchaseDetail> selectByPurchaseId(Integer purchaseId) {
        List<PurchaseDetail> purchaseDetails = purchaseDetailDao.selectByPurchaseId(purchaseId);
        return purchaseDetails;
    }

    @Override
    public List<ToEcharts> fivesalesvolumee() {
        List<ToEcharts> fivesalesvolumee = purchaseDetailDao.fivesalesvolumee();
        return fivesalesvolumee;
    }

    @Override
    public List<ToEcharts> fivesalesvolumel() {
        List<ToEcharts> fivesalesvolumel = purchaseDetailDao.fivesalesvolumel();
        return fivesalesvolumel;
    }
}
